package com.wcx.test.spring.config;

import com.wcx.test.spring.conditional.LinuxConditional;
import com.wcx.test.spring.conditional.WindowsConditional;
import com.wcx.test.spring.model.Person;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Conditional;
import org.springframework.context.annotation.Configuration;

@Configuration
public class PersonConfig {

    @Bean(name = "bill")
    @Conditional({WindowsConditional.class})
    public Person bill() {
        return new Person("bill", 88);
    }

    @Bean(name = "linus")
    @Conditional({LinuxConditional.class})
    public Person linus() {
        return new Person("linus", 77);
    }
}
